using System;
using System.Xml;
using Widgetsphere.Core.Util;
using System.Reflection;
using System.Configuration;
using  System.Security.Cryptography;


namespace Widgetsphere.Core.Util
{
	public sealed partial class CryptographyUtility
	{
		private CryptographyUtility()
		{}
		
		public static string GetEntropy(int length)
		{
			return ByteEncoding.BytesToBase64(GetRandomBytes(length));
		}

		public static byte[] GetRandomBytes(int length)
		{
			RandomNumberGenerator randNumGen = RandomNumberGenerator.Create();
			byte[] entropy = new byte[length];
			randNumGen.GetBytes(entropy);
			return entropy;
		}

		public static void ZeroMemory(byte[] pByte)
		{
			Array.Clear(pByte, 0, pByte.Length);
		}
	}
}
